   function http(url, params) {
     wx.showLoading({
       title: "加载中"
     })
     return new Promise((resolve, reject) => {
       let baseurl = `https://api-hmugo-web.itheima.net/api/`
       wx.request({
         ...params,
         url: baseurl + url,
         header: {
           Authorization: wx.getStorageSync('token')
         },
         success: (res => {
           resolve(res)
         }),
         file: (err => {
           reject(err)
         }),
         complete: (res => {
           wx.hideLoading()
           wx.stopPullDownRefresh()
         })
       })
     })
   }
   export default http